package com.yun.test03generate.common;

import org.apache.commons.lang3.StringUtils;
import java.util.Objects;

/**
 * @Author: fxy
 * @Date: 2021/09/09/17:39
 * @Description:
 */
public class Entity {
    protected String id;
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }


        Entity entity = (Entity) o;

        if(StringUtils.isBlank(this.getId()) || StringUtils.isBlank(entity.getId())) {
            return false;
        }

        return Objects.equals(this.getId(), entity.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hash(this.getId());
    }

}
